package com.landinfo.repository;

import com.landinfo.domain.ResourcesSurvey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 资源概况
 */
@SuppressWarnings("unused")
@Repository
public interface ResourcesSurveyRepository extends JpaRepository<ResourcesSurvey, String> {

    ResourcesSurvey findOneById(String id);
    
    List<ResourcesSurvey> findByXzqhCodeAndYearAndRegionType(String xzqhCode,Integer year,String regionType);

    List<ResourcesSurvey> findByXzqhParentCode(String xzqhCode);

    @Query("select distinct(u.year) from ResourcesSurvey u")
    List<Object> getYears();

}
